def application(environ, start_response):
    body = 'Hello World'
    status = '200 OK'
    headers = [
        ('Content-Type', 'text/plain'),
        ('Content-Length', str(len(body)))
    ]
    start_response(status, headers)
    return [body.encode()]


if __name__ == '__main__':
    from wsgiref.simple_server import make_server

    server = make_server('127.0.0.1', 3000, application)
    try:
        server.serve_forever()
    except KeyboardInterrupt:
        server.shutdown()
